home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
editor
/
flyerproc.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
6KB
|
242 lines
/* FlyerProc.rexx V3.5A -- (Batch) Interface Glue for FlyerProc */
/* By Bob Caron (Grue) ©1995 NewTek Inc. */
numeric digits 12
call remlib('PROJECT_REXX_PORT')
call remlib('ToasterARexx.port')
call addlib('PROJECT_REXX_PORT',0)
call addlib('ToasterARexx.port',0)
call set_view(2)
call REQ_ERROR("Flyer Proc V3.5A --- Process flyer clip(s).")
ncmd=0
thisisdone=0
do until thisisdone=1
cmdback=chooseclip()
if (ncmd=0 & cmdback="CANCEL") then call quit
if cmdback~="CANCEL" then do
ncmd=ncmd+1
cmd.ncmd=cmdback
icon.ncmd=iconname
end
call req_error("So far you have "||ncmd||" clips ready to process.")
if req_tell("Flyer Proc V3.5A","'Continue' to choose another clip.","'Cancel' to start processing.")=0 then thisisdone=1
end
call req_error("Note: While clips are being processed you can abort by using Control-C.")
if req_tell("Still want to continue?","Hit 'Continue' to process clips.","Hit 'Cancel' abort FlyerProc.")=0 then call quit()
call req_error("")
Switcher(TOWB)
do count=1 to ncmd
address command cmd.count
icontime=1
if ncmd=1 then do
Switcher(TOSW)
icontime=REQ_FLYERJOG("Choose frame for icon.",icon.ncmd,1)
if icontime="CANCEL" then icontime=1
icontime=icontime*2
end
call makeicon(icon.count,icontime)
end
Switcher(TOSW)
call req_error("All done.")
call remlib('PROJECT_REXX_PORT')
call remlib('ToasterARexx.port')
exit
quit: PROCEDURE
call req_error("Canceled.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit
isclip:
parse arg clipname
if open('CLIP',clipname,'R') then do
padding=readch('CLIP',12)
call close ('CLIP')
if substr(padding,1,4)='CLIP' then return 1
end
call close ('CLIP')
return 0
chooseclip:
/* The following stuff is just to get a filename with a path */
call startfilereq("Source Clip?","","")
exit=1
do while exit=1
file=queryfilereq()
if file=0 then return CANCEL
if file~="" then exit=0
address command "c:wait 1"
end
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
address command "c:cd "path
call pragma("D",path)
path=pragma("D","RAM:")
if right(path,1)=":" then Source=path||filenam
else Source=path||"/"||filenam
if isclip(source)=0 then do
call req_tell("Error!"," That isn't a clip!")
return CANCEL
end
if fields=-2 then do
call req_tell("Error!","I can't find that file.")
return CANCEL
end
/* end of that requestor */
/* Do that all over again for the destination */
call startfilereq("Save Clip Where?","FB0:","OutClip."||ncmd+1)
exit=1
do while exit=1
file=queryfilereq()
if file=0 then return CANCEL
if file~="" then exit=0
address command "c:wait 1"
end
if exists(file) then
if req_tell("Ok to overwrite this file?")=0 then return CANCEL
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
address command "c:cd "path
call pragma("D",path)
path=pragma("D","RAM:")
if right(path,1)=":" then dest=path||filenam
else dest=path||"/"||filenam
/* End of all that stuff */
times=REQ_FLYERJOG("Choose in and out points.",source,2)
if times="CANCEL" then return CANCEL
starttime=(word(times,1)*2)
endtime=(word(times,2)*2)
call req_error("Note: You can mix most processes. (Example: slow motion with reverse.)")
done=0
buttons='0000'
do while done=0
slowmo=0;speedup=0;strobe=0;reverse=0
buttons=req_buttons("Choose Clip Process:",buttons,"Speed Up","Slow Motion","Strobe","Reverse")
if buttons="CANCEL" then return CANCEL
if substr(buttons,1,1)="1" then do
speedup=1; done=1
end
if substr(buttons,2,1)="1" then do
slowmo=1; done=1
end
if substr(buttons,3,1)="1" then do
strobe=1; done=1
end
if substr(buttons,4,1)="1" then do
reverse=1; done=1
end
if slowmo=1 & speedup=1 then do
call req_tell("Error!","You can't mix SpeedUp with SlowMo.")
done=0
end
if strobe=1 & speedup=1 then do
call req_tell("Error!","You can't mix SpeedUp with Strobe.")
done=0
end
if strobe=1 & slowmo=1 then do
call req_tell("Error!","You can't mix SlowMo with Strobe.")
done=0
end
end
if speedup=1 then do
call req_error("Example: A value of 2 will make the clip twice as fast.")
number=req_number("Enter a Speed for SpeedUp",'2')
if number="CANCEL" then return CANCEL
if number<=0 then number=1
speed="x"||number
end
if slowmo=1 then do
call req_error("Example: A value of 3 will make the clip three times as long.")
number=req_number("Enter a Speed For SlowMo",3)
if number="CANCEL" then return CANCEL
if number<=0 then number=1
speed="/"||number
end
if strobe=1 then do
call req_error("This is the length of time, in fields, each image is shown.")
number=req_number("Number of fields to hold:",2)
if number="CANCEL" then return CANCEL
if number<=0 then number=1
speed="s"||number
call req_error("This is the number of fields to skip. (Strobe rate)")
number=req_number("Strobe at what field:",2)
if number="CANCEL" then return CANCEL
if number<=0 then number=1
speed=speed||","||number
end
if reverse=1 then speed="-"||speed
if reverse=1 & slowmo=0 & speedup=0 & strobe=0 then speed="-x1"
cmd="C:flyerproc >CON: "||'"'||source||'"'||" "starttime" "endtime" "||'"'||dest||'"'||" "speed""
iconname=dest
return cmd